<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>计算机动漫与游戏制作-freestudy</title>
    <!--视口 不缩放 -->
    <link rel="shortcut icon" th:href="@{/img/icon.gif}">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/zui/1.7.0/css/zui.min.css" rel="stylesheet">
    <link th:href="@{/css/main.css}" rel="stylesheet">
</head>

<body>
    <div id="page">
        <!-- header -->
        <header>
            <div class="container" th:fragment="pagination">
                <div class="logo pull-left">
                    <a th:href="@{'/index'}">
                        <img th:src="@{/img/logo.png}" alt="logo"><!-- 导航栏左上角图标 -->
                    </a>
                </div>
                <div class="link pull-left">
                    <a th:href="@{'/index'}">&nbsp;&nbsp;&nbsp;&nbsp;主页&nbsp;&nbsp;&nbsp;&nbsp;</a>
                    <a th:href="@{'/detail/index'}">&nbsp;&nbsp;&nbsp;课程介绍&nbsp;&nbsp;&nbsp;</a>
                    <a th:href="@{'/resource/index'}">&nbsp;&nbsp;&nbsp;全部课程&nbsp;&nbsp;&nbsp;</a>
                    <a th:href="@{'/lesson/detail?id=1'}">&nbsp;&nbsp;&nbsp;计算机动漫简介&nbsp;&nbsp;&nbsp;</a>
                    <a th:href="@{'/lesson/detail?id=2'}">&nbsp;&nbsp;&nbsp;3D基础知识&nbsp;&nbsp;&nbsp;</a>
                </div>
                <div class="user pull-right">
                    <span th:if="${#httpSession != null && #httpSession.getAttribute('username')!=null}" th:text="${#httpSession.getAttribute('username')}"></span>
                    <a th:if="${#httpSession != null && #httpSession.getAttribute('username')==null}" th:href="@{'/login/index'}">登录/注册</a>
                    <a th:if="${#httpSession == null}" th:href="@{'/login/index'}">登录/注册</a>
                </div>
            </div>
        </header><!-- header end -->
        <!-- 基础js -->
        <script th:src="@{/js/jquery.min.js}"></script>
        <script th:src="@{/js/zui.min.js}"></script>
        <script th:src="@{/js/jquery.qrcode.min.js}"></script>
        <script th:src="@{/js/main.js}"></script>
        <!-- 基础js end-->
        <script>
        $("#feedback .btn").on("click", function() {
            var j = $("#input1").val();
            var m = $("#text1").val();

            if (j || m) {
                $.post("index.php?m=Feedback&a=addfeed", { description: j, content: m }, function(result) {
                    alert("提交成功")
                    $("#feedback").modal("hide");
                })
            } else {
                alert("请输入反馈内容");
                return false;
            }
        })


        $(function() {
            //active show
            // var search = window.location.search;
            var href = window.location.href;
            var urll = document.location.toString();
            var arrUrl = urll.split("/");
            if (window.location.search == "" || arrUrl[3] == '' || arrUrl[3] == 'index.php') return $("header .link a").eq(0).addClass("active");
            $("header .link a").each(function() {
                // var $this = $(this);
                // var href = $this.attr("href");
                // href = href.replace(/index.php/g, "");
                // if (href == search) {
                //     $this.addClass("active");
                // }

                var that = $(this);
                var link = that.attr("href").replace("index.php?", "")
                if (href.search(link) >= 1) {
                    $(this).addClass("active");
                }

            })
        })
        </script>
        <script>
        window.alert = function(name) {
            var iframe = document.createElement("IFRAME");
            iframe.style.display = "none";
            iframe.setAttribute("src", 'data:text/plain,');
            document.documentElement.appendChild(iframe);
            window.frames[0].window.alert(name);
            iframe.parentNode.removeChild(iframe);
        };
        </script>
    </div>
    <script>
    $(function() {
        var obj = $("[data-big]");
        var img = new Image();
        img.src = obj.data("big");
        img.onload = function() {
            obj.attr("src", obj.data("big"));
            var h = obj.width() / (640 / 360) + "px";
            obj.css("height", h)
        };
        img.onerror = function() {
            obj.src = "/Public/dist/image/imgBig.jpg"
        }
    })
    </script>
</body>

</html>
